package org.hry.netty.codec;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.handler.timeout.IdleState;
import io.netty.handler.timeout.IdleStateEvent;

/**
 * @Desc
 * @Author houry
 * @Date 2021/2/20 15:43
 **/
public class MyServerHandler extends SimpleChannelInboundHandler<String> {




    @Override
    protected void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {
        System.out.println("[MyServerHandler]-[channelRead0]-[被调用]-[接收到信息：" + msg + "]");
    }

    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
        System.out.println("[MyServerHandler]-[exceptionCaught]-[被调用]");
        cause.printStackTrace();
    }


}
